<?php
if(Auth::islogin()){
	$db = getDb();
	$db->execute("DELETE FROM online WHERE o_user={0}",array(Auth::GetData('admin_name')));
	$db->execute("INSERT INTO online(o_user,o_time,o_type) VALUES({0},{1},{2})",array(Auth::GetData('admin_name'),time(),1));
}
else {
	@session_start();		
	$user = session_id();
	$db = getDb();
	$db->execute("DELETE FROM online WHERE o_user={0}",array($user));
	$db->execute("INSERT INTO online(o_user,o_time,o_type) VALUES({0},{1},{2})",array($user,time(),0));
}
?>